package com.samphanie.auiu.library.restful

import androidx.annotation.IntDef
import java.lang.reflect.Method
import java.lang.reflect.Type

/**
 * @author Dries
 **/
open class AuiuRequest {

    @METHOD
    var httpMethod: Int = 0  // GET POST
    var formPost: Boolean = false    // 是否表单提交，POST请求有效
    var headers: MutableMap<String, String>? = null  // 请求头
    var parameters: MutableMap<String, Any>? = null  // 请求入参
    var domainUrl: String? = null    // 域名
    var relativeUrl: String? = null  // 相对路径
    var returnType: Type? = null     // restful 方法的泛型返回值

    @IntDef(value = [METHOD.GET, METHOD.POST])
    annotation class METHOD {
        companion object {
            const val GET = 0
            const val POST = 1
        }
    }
}